from django.core.files.storage import Storage


"""自定义文件存储类"""
class FastDFSStorage(Storage):

    def _open(self, name, mode='rb'):
        """用于打开文件"""
        pass

    def _save(self, name, content):
        """文件上传时会调用此方法"""

        pass

    def url(self, name):
        """使用image字段url属性时，会调用此方法"""


        return 'http://192.168.32.146:8888/' + name